import express from 'express';
import dotenv from 'dotenv';
import corsMiddleware from './middlewares/cors/index.js';
import { login } from './controllers/auth/index.js';

dotenv.config();
const app = express();
const port = process.env.PORT || 3000;


// 中间件
app.use(express.json());
app.use(corsMiddleware);

app.post('/user/login', login);

const bootstarp = () => {
    app.listen(port, () => {
        console.log(`Server is running at http://localhost:${port}`);
    });
}

bootstarp()
